from selenium import webdriver
import time
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

web = webdriver.Chrome()
web.maximize_window()
time.sleep(3)
web.get("https://www.csdn.net")

time.sleep(3)
web.find_element(By.ID,"toolbar-search-input").send_keys(Keys)
element = web.find_element(By.ID,"toolbar-search-button")
action = ActionChains(web)
action.double_click(element)
action.perform()
time.sleep(3)
web.find_element_by_partial_link_text('前端').click()
print(web.find_element_by_partial_link_text('前端').size)
print(web.find_element_by_partial_link_text('前端').text)
print(web.find_element_by_partial_link_text('前端').get_attribute("前端"))
print(web.title)
print(web.current_url)
print("判断前端是否可视:",web.find_element_by_partial_link_text('前端').is_displayed())
print("判断前端是否可用:",web.find_element_by_partial_link_text('前端').is_enabled())

web.refresh()

web.quit()